SRCS= $(wildcard *.cpp)
INCDIR=
DEFINES += 

PQPSRCS = $(wildcard PQP/*.cpp)
PQPOBJS= $(PQPSRCS:.cpp=.o)


STD_INCLUDES= /usr/include/
STD_LIBS=
PY_INCLUDES= /usr/include/python2.6/
PY_LIBS= -L/usr/lib/
LIBS= $(STD_LIBS) $(PY_LIBS) $(KRIS_LIBS)

INCDIR = $(PY_INCLUDES)

include Makefile.template

SWIG = swig

#SO_FLAGS = -dynamiclib
SO_FLAGS = -shared

#PY_LIB = python
PY_LIB = python2.6
#PY_LIB = python2.6.dll

.PHONY: clean lib pqp default lib

default: lib
	@echo Done.

pqp:
	cd PQP; make

collide_wrap.o: collide_wrap.cxx
	g++ -Wall -fPIC collide_wrap.cxx -o $(OBJDIR)/collide_wrap.o -I$(PY_INCLUDES) -c

collide_wrap.cxx: collide.i collide.h pyerr.h
	$(SWIG) -c++ -python collide.i

clean:
	rm -rf $(OBJDIR)
	rm collide_wrap.cxx
	rm _collide.so

lib: pqp $(OBJS) collide_wrap.o
	g++ -Wall $(SO_FLAGS) $(addprefix $(OBJDIR)/,$(OBJS)) $(PQPOBJS) $(OBJDIR)/collide_wrap.o -l$(PY_LIB) -o _collide.so

cygwin: lib
	cp _collide.so _collide.dll



